snippet main
	int main(int argc, const char *argv[]) {
		${1}
		return 0;
	}
snippet inc
	#include <${1:stdio}>${2}
snippet def
	#define 
snippet ifdef
	#ifdef ${1:LOCAL}
		${2}
	#endif
snippet #if
	#if ${1:FOO}
		${2}
	#endif
# Header Include-Guard
# (the randomizer code is taken directly from TextMate; it could probably be
# cleaner, I don't know how to do it in vim script)
snippet once
	#ifndef ${1:`toupper(Filename('', 'UNTITLED').'_'.system("/usr/bin/ruby -e 'print (rand * 2821109907455).round.to_s(36)'"))`}

	#define $1

	${2}

	#endif /* end of include guard: $1 */
# If Condition
snippet if
	if (${1}) {
		${2}
	}
snippet el
	else {
		${1}
	}
snippet do
	do {
		${2:/* code */}
	} while (${1:/* condition */});
snippet wh
	while (${1}) {
		${2}
	}
snippet for
	for (int ${1:i} = 0; $1 < ${2:n}; $1++) {
		${3}
	}
snippet fo
	for (${1}) {
		${2}
	}
snippet fun
	${1:void} ${2:function_name}(${3}) {
		${4:/* code */}
	}
snippet fund
	${1:void} ${2:function_name}(${3});${4}
snippet td
	typedef ${1:int} ${2:MyCustomType};${3}
snippet tds
	typedef struct ${2:_$1 }{
		${3:/* data */}
	} ${1:`Filename('$1_t', 'name')`};
snippet tde
	typedef enum {
		${1:/* data */}
	} ${2:foo};
# printf
# unfortunately version this isn't as nice as TextMates's, given the lack of a
# dynamic `...`
snippet sc
	scanf("${1}", ${2});
snippet pr
	printf("${1}"${2});
# fprintf (again, this isn't as nice as TextMate's version, but it works)
snippet fpr
	fprintf(${1:stderr}, "${2:%s}\n"${3});${4}
snippet un
	unsigned
snippet fr
	freopen("${1}", "${2}", ${3});
snippet st
	struct ${1} {
		${2}
	};
